import request from '@/utils/request'

/**
 * 获取模型数据列表
 * @param query
 */
export function fetchList(query) {
  return request({
    url: '/model/page',
    method: 'get',
    params: query
  })
}

/**
 * 创建模型
 * @param model
 */
export function createModel(model) {
  return request({
    url: '/model/create',
    method: 'post',
    data:model
  })
}

/**
 * 删除模型
 * @param model
 */
export function deleteModel(modelId) {
  return request({
    url: `/model/delete/${modelId}`,
    method: 'get',
  })
}

/**
 * 部署流程
 * @param modelId
 */
export function deployModel(modelId) {
  return request({
    url: `/model/deploy/${modelId}`,
    method: 'get',
  })
}

/**
 * 导出模型文档 xml,json
 * @param modelId
 * @param type
 */
export function exportModel(modelId, type) {
  return request({
    url: `/model/export/${modelId}/${type}`,
    method: 'get',
  })
}


